﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Framework;
using Infrastructure.DataObjects;
using Domain.Module.Events;
using Infrastructure.DataObject;
using Framework.Event;
using System.Data.Entity;

namespace Domain.Module.Entities
{
 //   [DbContext("Infrastructure.Persistance.Context.SampleModelContainer, Infrastructure.Persistance")]
    public partial class MBlog
	{
        public override CommentType CommonType
        {
            get
            {
                return CommentType.MBlog;
            }
        }

        public static MBlog Create(MBlogObject mblogObject)
        {
            return new MBlog
                    {
                        ID = mblogObject.ID,
                        Body = mblogObject.Body,
                        CreateTime = mblogObject.CreateTime
                    };
        }

        [Handles(typeof(CommentEvent))]
        protected override void HandleCommentEvent(CommentEvent e)
        {
            Console.Write("MBLog " + e.ToString());
        }
    }
}
